//
//  RoomInfoApi.m
//  SmartiOSPublisher
//
//  Created by Liu,Qingcan on 2017/4/26.
//  Copyright © 2017年 Baidu. All rights reserved.
//

#import "RoomInfoApi.h"

@implementation RoomInfoApi{
    NSInteger _cateId;
    NSInteger _pageNumber;
    NSInteger _postNumber;//可选参数， -- 如果不传，默认为10
}
- (id)initWithCategoryId:(NSInteger)cateId pageNumber:(NSInteger)pageNumber hopeNumber:(NSInteger) hopeNumber{
    self = [super init];
    if (self) {
        _cateId = cateId;
        _pageNumber = pageNumber;
        _postNumber = hopeNumber;
    }
    return self;
}

- (NSString *)requestUrl{
    return @"/room/get_room";
}

- (YTKRequestMethod)requestMethod{
    return YTKRequestMethodPOST;
}


- (YTKRequestSerializerType)requestSerializerType{
    return YTKRequestSerializerTypeJSON;
}

- (id)requestArgument{
    if (_postNumber == 0) {
        return @{
                 @"id":[NSNumber numberWithInteger:_cateId],
                 @"pageNumber":[NSNumber numberWithInteger:_pageNumber],
//                 @"postNumber":[NSNumber numberWithInteger:_postNumber] //暂时不穿，看服务器石佛响应
                 };
    }else{
        return @{
                 @"id":[NSNumber numberWithInteger:_cateId],
                 @"pageNumber":[NSNumber numberWithInteger:_pageNumber],
                 @"postNumber":[NSNumber numberWithInteger:_postNumber]
                 };
    }
    
}


@end
